package csc.fresher.spring.model;


import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import csc.fresher.spring.annotationuniqueusername.UniqueUsername;
import csc.fresher.spring.anotationcardnumber.CardNumber;
import csc.fresher.spring.anotationfirstlastname.FirstLastName;
import csc.fresher.spring.anotationphone.Phone;
import csc.fresher.spring.anotationusername.Username;

public class User {
	@Size(min=5, message="Username at least 5 characters")
	@Username
	@UniqueUsername
	private String username;
	
	@Size(min=8, message="Password at least 8 characters")
	private String password;
	
	@CardNumber
	private String idcard;
	
	@FirstLastName
	private String firstname;
	
	@FirstLastName
	private String lastname;
	
	@Phone
	private String phone;
	
	@NotEmpty(message="Email not empty")
	@Email(message="Invalid Email")
	private String email;
	
	public User() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	public User(String username, String password, String idcard, String firstname,
			String lastname, String phone, String email) {
		super();
		this.username = username;
		this.password = password;
		this.idcard = idcard;
		this.firstname = firstname;
		this.lastname = lastname;
		this.phone = phone;
		this.email = email;
	}



	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getIdcard() {
		return idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
}
